{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2024-08-23T14:59:56.797971400Z",
     "start_time": "2024-08-23T14:59:56.783014200Z"
    }
   },
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "./最终数据/Java.csv\n",
      "./最终数据/C_C++.csv\n",
      "./最终数据/PHP.csv\n",
      "./最终数据/Python.csv\n",
      "./最终数据/C#.csv\n",
      "./最终数据/.NET.csv\n",
      "./最终数据/Golang.csv\n",
      "./最终数据/Node.js.csv\n",
      "./最终数据/Hadoop.csv\n",
      "./最终数据/语音_视频_图形开发.csv\n",
      "./最终数据/GIS工程师.csv\n",
      "./最终数据/区块链工程师.csv\n",
      "./最终数据/全栈工程师.csv\n",
      "./最终数据/其他后端开发.csv\n",
      "./最终数据/前端开发工程师.csv\n",
      "./最终数据/Android.csv\n",
      "./最终数据/iOS.csv\n",
      "./最终数据/U3D.csv\n",
      "./最终数据/UE4.csv\n",
      "./最终数据/Cocos.csv\n",
      "./最终数据/技术美术.csv\n",
      "./最终数据/JavaScript.csv\n",
      "./最终数据/鸿蒙开发工程师.csv\n",
      "./最终数据/测试工程师.csv\n",
      "./最终数据/软件测试.csv\n",
      "./最终数据/自动化测试.csv\n",
      "./最终数据/功能测试.csv\n",
      "./最终数据/测试开发.csv\n",
      "./最终数据/硬件测试.csv\n",
      "./最终数据/游戏测试.csv\n",
      "./最终数据/性能测试.csv\n",
      "./最终数据/渗透测试.csv\n",
      "./最终数据/测试经理.csv\n",
      "./最终数据/运维工程师.csv\n",
      "./最终数据/IT技术支持.csv\n",
      "./最终数据/网络工程师.csv\n",
      "./最终数据/网络安全.csv\n",
      "./最终数据/系统工程师.csv\n",
      "./最终数据/运维开发工程师.csv\n",
      "./最终数据/系统管理员.csv\n",
      "./最终数据/DBA.csv\n",
      "./最终数据/系统安全.csv\n",
      "./最终数据/技术文档工程师.csv\n",
      "./最终数据/图像算法.csv\n",
      "./最终数据/自然语言处理算法.csv\n",
      "./最终数据/大模型算法.csv\n",
      "./最终数据/数据挖掘.csv\n",
      "./最终数据/规控算法.csv\n",
      "./最终数据/SLAM算法.csv\n",
      "./最终数据/推荐算法.csv\n",
      "./最终数据/搜索算法.csv\n",
      "./最终数据/语音算法.csv\n",
      "./最终数据/风控算法.csv\n",
      "./最终数据/算法研究员.csv\n",
      "./最终数据/算法工程师.csv\n",
      "./最终数据/机器学习.csv\n",
      "./最终数据/深度学习.csv\n",
      "./最终数据/自动驾驶系统工程师.csv\n",
      "./最终数据/数据标注_AI训练师.csv\n",
      "./最终数据/售前技术支持.csv\n",
      "./最终数据/售后技术支持.csv\n",
      "./最终数据/销售技术支持.csv\n",
      "./最终数据/客户成功.csv\n",
      "./最终数据/数据分析师.csv\n",
      "./最终数据/数据开发.csv\n",
      "./最终数据/数据仓库.csv\n",
      "./最终数据/ETL工程师.csv\n",
      "./最终数据/数据挖掘.csv\n",
      "./最终数据/数据架构师.csv\n",
      "./最终数据/爬虫工程师.csv\n",
      "./最终数据/数据采集.csv\n",
      "./最终数据/项目经理_主管.csv\n",
      "./最终数据/项目助理.csv\n",
      "./最终数据/项目专员.csv\n",
      "./最终数据/实施工程师.csv\n",
      "./最终数据/实施顾问.csv\n",
      "./最终数据/需求分析工程师.csv\n",
      "./最终数据/硬件项目经理.csv\n",
      "./最终数据/技术经理.csv\n",
      "./最终数据/架构师.csv\n",
      "./最终数据/技术总监.csv\n",
      "./最终数据/CTO_CIO.csv\n",
      "./最终数据/技术合伙人.csv\n",
      "./最终数据/运维总监.csv\n",
      "./最终数据/其他技术职位.csv\n"
     ]
    }
   ],
   "source": [
    "#读取pois_code文件获取文件名进行统计\n",
    "pois_code=pd.read_csv(\"end_pois_code.csv\")\n",
    "df=pois_code[0:85]\n",
    "# 迭代每一行\n",
    "poisname=df.iterrows()\n",
    "for index,row in poisname:\n",
    "    csvname=row['职位']\n",
    "    poiscode=row['编号']\n",
    "    file_name=csvname.replace(\"/\",\"_\")\n",
    "    # print(file_name)\n",
    "    csv_file_name=f\"./最终数据/{file_name}.csv\"\n",
    "    print(csv_file_name)"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-08-23T14:59:45.105940Z",
     "start_time": "2024-08-23T14:59:45.094969800Z"
    }
   },
   "id": "369320282e9c7844"
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "jobname\n",
      "salaryDesc\n",
      "jobLabels\n",
      "skills\n",
      "jobExperience\n",
      "jobDegree\n",
      "cityName\n",
      "areaDistrict\n",
      "businessDistrict\n",
      "brandName\n",
      "brandStageName\n",
      "brandIndustry\n",
      "brandScaleName\n",
      "welfareList\n"
     ]
    }
   ],
   "source": [
    "df=pd.read_csv('./最终数据/Java.csv')\n",
    "for column in df.columns:\n",
    "    print(column)"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-08-23T16:04:55.975449300Z",
     "start_time": "2024-08-23T16:04:55.960486600Z"
    }
   },
   "id": "37cc1913dd17a8f6"
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['8-13K']\n",
      "['8-13K', '13薪']\n",
      "['20-30K']\n",
      "['15-25K', '14薪']\n",
      "['25-45K', '14薪']\n",
      "['15-25K']\n",
      "['8-13K']\n",
      "['20-40K']\n",
      "['15-22K']\n",
      "['15-20K']\n",
      "['12-20K']\n",
      "['7-12K']\n",
      "['10-11K']\n",
      "['15-30K', '15薪']\n",
      "['10-15K']\n",
      "['12-15K', '13薪']\n",
      "['18-30K']\n",
      "['15-25K', '15薪']\n",
      "['11-16K']\n",
      "['20-35K', '15薪']\n",
      "['15-18K', '13薪']\n",
      "['25-35K', '14薪']\n",
      "['13-19K']\n",
      "['16-22K']\n",
      "['12-24K']\n",
      "['12-22K', '13薪']\n",
      "['25-35K']\n",
      "['10-15K']\n",
      "['15-30K']\n",
      "['10-12K']\n"
     ]
    }
   ],
   "source": [
    "df1=df['salaryDesc']\n",
    "for text1 in df1:\n",
    "    end_dt=text1.split(\"·\")\n",
    "    print(end_dt)"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-08-23T16:10:10.944362700Z",
     "start_time": "2024-08-23T16:10:10.934388800Z"
    }
   },
   "id": "efef992f046a51"
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   salaryDesc salary_range\n",
      "0       8-13K        8-13K\n",
      "1   8-13K·13薪        8-13K\n",
      "2      20-30K       20-30K\n",
      "3  15-25K·14薪       15-25K\n",
      "4  25-45K·14薪       25-45K\n"
     ]
    }
   ],
   "source": [
    "import re  \n",
    "df=pd.read_csv('./最终数据/Java.csv')\n",
    "# 定义一个函数来提取薪资信息  \n",
    "def extract_salary(text):  \n",
    "    # 使用正则表达式匹配薪资信息  \n",
    "    matches = re.findall(r'(\\d+-\\d+K)(?:·\\d+薪)?', text)  \n",
    "    if matches:  \n",
    "        return matches[0]  # 假设每行只有一个薪资信息  \n",
    "    return None  \n",
    "  \n",
    "# 应用函数到DataFrame的薪资列（假设列名为'salary_text'）  \n",
    "df['salary_range'] = df['salaryDesc'].apply(extract_salary)  \n",
    "  \n",
    "# 查看结果  \n",
    "print(df[['salaryDesc', 'salary_range']].head())"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-08-23T15:53:59.592899Z",
     "start_time": "2024-08-23T15:53:59.539014700Z"
    }
   },
   "id": "76f424673b552570"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
